

<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header"><?php echo __('List of languages'); ?></h1>
    </div>
     <div class="col-lg-6">   
              <div class="form-group input-group">
                    <a class="btn btn-success" href="<?php echo $this->Html->url(array('action' => 'add')); ?>"><?php echo __('Add Language '); ?><i class="fa fa-plus"></i></a>
               </div>
    </div>
    <div class="col-lg-6">
 
                <div class="form-group input-group">
                    <input type="text" id='serach' class="form-control" placeholder='Search ...'>
                            <span class="input-group-btn">
                    <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
                            </span>
                </div>

    </div>
               
</div>


<!-- /.row -->
<div class="row">
                <div class="col-lg-12">
                   
 <!--  Block dataTable -->  
                 
<div class="panel panel-default">
    <div class="panel-heading">
                        	<?php echo __('List of languages'); ?>
    </div>
                        <!-- /.panel-heading -->
     <div class="panel-body">
                            <div class="table-responsive" id="searchByLanguage">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            
                                            <th><?php echo __('Language'); ?></th>
                                            
                                            <th><?php echo __('Action'); ?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        	<?php foreach ($languages as $language): ?>
                                        
                                        <tr class="gradeA">
                                            <td><?php echo h($language['Language']['label']); ?>&nbsp;</td>
                                            <td>
                                            	<?php echo $this->Html->link(__('View'), array('action' => 'view', $language['Language']['id'])); ?>
			<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $language['Language']['id'])); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $language['Language']['id']), null, __('Are you sure you want to delete # %s?', $language['Language']['id'])); ?>
                                            </td>
                                           
                                        </tr>
                                       
                                        <?php endforeach; ?>
                                    </tbody>
                                </table>
                                <?php echo  $this->element('paginate'); ?>
                            </div>
                            
                        </div>
                        <!-- /.panel-body -->
</div>
</div>
</div>

  
  <script>
$("#serach").keyup(function(){

                var language=$(this).val();
                var url = "Languages/searchByLanguage/"+language;
                $("#searchByLanguage").html('<div style="padding-top:20px;padding-bottom:20px;text-align:center;"><img src="img/load.gif"></div>');
                $.get(url, function(data) {
                     

                    $("#searchByLanguage").html(data);
                });
            });

</script>
